using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HealthPotion : MonoBehaviour
{
    private GameObject prefabHealEffect;

    // Start is called before the first frame update
    void Start()
    {
        prefabHealEffect = Resources.Load<GameObject>("Prefabs/Effects/Stars");
    }

    // Update is called once per frame
    void Update()
    {

    }

    void OnTriggerEnter2D(Collider2D collision)
    {
        if (LunaStatusManager.Instance.CurrentHP < LunaStatusManager.MaxHP)
        {
            LunaStatusManager.Instance.ChangeHP(10);
            Instantiate(prefabHealEffect, transform.position, Quaternion.identity);
            Destroy(gameObject);
        }
    }
}
